package com.dy.cloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @ClassName:
 * @Author: 仄言in
 * @Desctiption: (描述) 创建RestTemplate的Bean
 * @Date: 2021/9/3 14:25
 * @Version 1.0 (版本)
 */
@Configuration
public class RestTemplateConfig {
    @Bean
    @LoadBalanced       //@LoadBalanced:RestTemplate，简单轮询负载均衡
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }
}
